
/***************************************************************************
    Author		         : Kashyap R Puranik
    email                : kashthealien@gmail.com

 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
 
#include "calculator.h"

#include <kdebug.h>
#include <kactioncollection.h>
#include <kstandardaction.h>
#include <ktoolinvocation.h>

calculator :: calculator ( QWidget *parent )
  : KDialog( parent )
{
	setCaption( i18n( "Molecular Calculator" ) );
	setButtons( Help | Close );
	setDefaultButton( Close );

	ui.setupUi( mainWidget() );
	
	m_nuclearCalculator = new nuclearCalculator ( this );
	ui . stack -> addWidget ( m_nuclearCalculator );

	connect( ui . tree, SIGNAL(itemClicked ( QTreeWidgetItem * , int ) ), this,
            SLOT ( slotItemSelection ( QTreeWidgetItem * ) ) );
}

calculator :: ~calculator ()
{

}

void calculator :: slotItemSelection(QTreeWidgetItem *item)
{
	if (item==0L) return;

    //DEBUG
    kDebug() << "Item clicked: " << item->text(0);

    QString s = item -> text ( 0 );

    if( ! ( s . compare ( i18n ( "Nuclear Calculator" ) ) ) )
        ui . stack -> setCurrentWidget ( m_nuclearCalculator );
}
